package helper

import (
	"chatgpt/helper/code"
	"github.com/gin-gonic/gin"
	"net/http"
)

type Response struct {
	MsgCode int
	Desc    string
	Data    any
	Tokens  int
}

func Echo(ctx *gin.Context, codeno int, data any) {
	desc := code.CODENO(codeno)
	ctx.JSON(http.StatusOK, &Response{MsgCode: codeno, Data: data, Desc: desc.String()})
}
